package com.ruoyi.web.controller.openai;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.feign.OpenAiServiceClient;
import com.ruoyi.system.feign.result.FeignDataResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/openai")
public class OpenAiController extends BaseController {
    @Autowired
    private OpenAiServiceClient openAiServiceClient;

    @GetMapping("/health")
    @ResponseBody
    public AjaxResult health(ModelMap mmap) {
        FeignDataResult<String> result = openAiServiceClient.health();
        return AjaxResult.success(result.getMsg());
    }


}
